﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BaseUtilities
{
    public class ResultModel
    {
        public ResultModel()
        {
        }
        public ResultModel(object pResult)
        {
            _Result = pResult;
        }

        // Result.
        private object _Result;
        public object Result
        {
            get { return _Result; }
            set { _Result = value; }
        }
        // HasError.
        private bool _HasError;
        public bool HasError
        {
            get { return _HasError; }
            set { _HasError = value; }
        }
        // ErrorNumber.
        private int _ErrorNumber;
        public int ErrorNumber
        {
            get { return _ErrorNumber; }
            set { _ErrorNumber = value; }
        }
        // Message.
        private string _Message;
        public string Message
        {
            get { return _Message; }
            set { _Message = value; }
        }
        // Exception.
        private Exception _Exception;
        public Exception Exception
        {
            get { return _Exception; }
            set { _Exception = value; }
        }

        public T ToResult<T>()
        {
            return (T)this.Result;
        }
    }
}
